// pages/video/video.js
//调用方式/pages/video/video?url=encodeURIComponent('www.baidu.com')&title=encodeURIComponent('标题');
//参数必须通过uri编码后传递
var util = require('../../utils/util.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    url: null,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var url = decodeURIComponent(options.url)
    this.setData({
      url: url,
    })
    var title = options.title
    if (title) {
      wx.setNavigationBarTitle({
        title: decodeURIComponent(title),
      })
    }
  },
  onReady: function () {
    this.videoContext = wx.createVideoContext('myvideo', this);
    this.videoContext.requestFullScreen({ direction: 90 });
  },
  onShareAppMessage: function (res) {
    return util.handleShareApp()
  },
})